import { Custom, CustomEnum } from 'custom/index'

export default class ListPageTabs extends Custom {
  public static name: CustomEnum = 'ListPageAsyncTabs';

  protected static emits = {
    'tab-change': 'getData'
  }

  private _default
  public getDefault() {
    return this._default
  }
  // public setDefualt(value: any) {
  //   this._default = value
  //   return this
  // }

  public setProp(prop: string) {
    this._props.prop = prop
    return this
  }
  public getProp() {
    return this._props.prop
  }

  public api(api: () => Promise<any[]>) {
    this._props.api = api
    return this
  }

  public setAsyncDefault(setAsyncDefault: (tabs: any[]) => any) {
    this._props.setAsyncDefault = setAsyncDefault
    return this
  }

  end() {
    return this.upto('ListPage')
  }
}
